#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e6 + 5;
int s[MAXN], m;
int main(){
    cin >> m;
    for (int i  = 1; i <= m; i++){
        s[i] = s[i - 1] + i;
    }
    for (int i = 1; i <= m; i++){
        for (int j = i + 1; j <= m; j++){
            int t = s[j] - s[i - 1];
            if (t == m){
                cout << i << " " << j << endl;
            }
            else if (t > m){
                break;
            }
        }
    }
    return 0;
}